/*
 * @Author: zhigang
 * @Date:   2016-07-29 15:57:29
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2016-08-11 23:12:29
 */
var fs = require('fs'),
    path = require('path'),
    events = require('events');
    http = require('http');

    console

    console.log(23)


var eventEmitter = new events.EventEmitter();  

var connectHandler = function connected(){
    console.log('连接成功');
    eventEmitter.emit('data_received');
}  
eventEmitter.on('data_received',function(){
    console.log('数据接受成功')
});

eventEmitter.on('connection',function(){
    console.log('数据连接成功')
})

eventEmitter.emit('connection')

var data = fs.readFileSync('input.txt');
console.log(data.toString());
console.log('end')

fs.readFile('input.txt',function(err,data){
    console.log(err,data)
    if(err){
        console.log(err)
    }
})